<!doctype html>



  


<html class="theme-next pisces use-motion" lang="zh-Hans">
<head>
  <meta charset="UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=edge" />
<meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1"/>









<meta http-equiv="Cache-Control" content="no-transform" />
<meta http-equiv="Cache-Control" content="no-siteapp" />















  
  
  <link href="/lib/fancybox/source/jquery.fancybox.css?v=2.1.5" rel="stylesheet" type="text/css" />




  
  
  
  

  
    
    
  

  

  

  

  

  
    
    
    <link href="//fonts.googleapis.com/css?family=Lato:300,300italic,400,400italic,700,700italic&subset=latin,latin-ext" rel="stylesheet" type="text/css">
  






<link href="/lib/font-awesome/css/font-awesome.min.css?v=4.6.2" rel="stylesheet" type="text/css" />

<link href="/css/main.css?v=5.1.1" rel="stylesheet" type="text/css" />


  <meta name="keywords" content="java,大数据,kafka,storm," />








  <link rel="shortcut icon" type="image/x-icon" href="/favicon.ico?v=5.1.1" />






<meta name="description" content="前言   storm和kafka集群安装是没有必然联系的，我将这两个写在一起，是因为他们都是由zookeeper进行管理的，也都依赖于JDK的环境，为了不重复再写一遍配置，所以我将这两个写在一起。若只需一个，只需挑选自己选择的阅读即可。 这两者的依赖如下:  Storm集群：JDK1.8 , Zookeeper3.4，Storm1.1.1； Kafa集群 : JDK1.8 ，Zookeeper3">
<meta name="keywords" content="java,大数据,kafka,storm">
<meta property="og:type" content="article">
<meta property="og:title" content="kafka和storm集群的环境安装">
<meta property="og:url" content="http://yoursite.com/2018/01/26/pancm70/index.html">
<meta property="og:site_name" content="虚无境的博客">
<meta property="og:description" content="前言   storm和kafka集群安装是没有必然联系的，我将这两个写在一起，是因为他们都是由zookeeper进行管理的，也都依赖于JDK的环境，为了不重复再写一遍配置，所以我将这两个写在一起。若只需一个，只需挑选自己选择的阅读即可。 这两者的依赖如下:  Storm集群：JDK1.8 , Zookeeper3.4，Storm1.1.1； Kafa集群 : JDK1.8 ，Zookeeper3">
<meta property="og:image" content="http://img.blog.csdn.net/20171230151037761?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171230151047319?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171230151054538?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171230152536678?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171230152800716?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20171230152823369?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20180126203955725?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20180126204334259?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20180126204325034?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20180126204703636?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20180126205434422?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20180126210106287?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:image" content="http://img.blog.csdn.net/20180126210233242?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">
<meta property="og:updated_time" content="2018-02-09T11:55:52.000Z">
<meta name="twitter:card" content="summary">
<meta name="twitter:title" content="kafka和storm集群的环境安装">
<meta name="twitter:description" content="前言   storm和kafka集群安装是没有必然联系的，我将这两个写在一起，是因为他们都是由zookeeper进行管理的，也都依赖于JDK的环境，为了不重复再写一遍配置，所以我将这两个写在一起。若只需一个，只需挑选自己选择的阅读即可。 这两者的依赖如下:  Storm集群：JDK1.8 , Zookeeper3.4，Storm1.1.1； Kafa集群 : JDK1.8 ，Zookeeper3">
<meta name="twitter:image" content="http://img.blog.csdn.net/20171230151037761?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast">



<script type="text/javascript" id="hexo.configurations">
  var NexT = window.NexT || {};
  var CONFIG = {
    root: '/',
    scheme: 'Pisces',
    sidebar: {"position":"left","display":"post","offset":12,"offset_float":0,"b2t":false,"scrollpercent":false},
    fancybox: true,
    motion: true,
    duoshuo: {
      userId: '0',
      author: '博主'
    },
    algolia: {
      applicationID: '',
      apiKey: '',
      indexName: '',
      hits: {"per_page":10},
      labels: {"input_placeholder":"Search for Posts","hits_empty":"We didn't find any results for the search: ${query}","hits_stats":"${hits} results found in ${time} ms"}
    }
  };
</script>



  <link rel="canonical" href="http://yoursite.com/2018/01/26/pancm70/"/>






  <title>kafka和storm集群的环境安装 | 虚无境的博客</title>
  





  <script type="text/javascript">
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?39c177d10f6e05ddfa113e02139b9c1c";
      var s = document.getElementsByTagName("script")[0];
      s.parentNode.insertBefore(hm, s);
    })();
  </script>










</head>

<body itemscope itemtype="http://schema.org/WebPage" lang="zh-Hans">

  
  
    
  

  <div class="container sidebar-position-left page-post-detail ">
    <div class="headband"></div>

    <header id="header" class="header" itemscope itemtype="http://schema.org/WPHeader">
      <div class="header-inner"><div class="site-brand-wrapper">
  <div class="site-meta ">
    

    <div class="custom-logo-site-title">
      <a href="/"  class="brand" rel="start">
        <span class="logo-line-before"><i></i></span>
        <span class="site-title">虚无境的博客</span>
        <span class="logo-line-after"><i></i></span>
      </a>
    </div>
      
        <p class="site-subtitle"></p>
      
  </div>

  <div class="site-nav-toggle">
    <button>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
      <span class="btn-bar"></span>
    </button>
  </div>
</div>

<nav class="site-nav">
  

  
    <ul id="menu" class="menu">
      
        
        <li class="menu-item menu-item-home">
          <a href="/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-home"></i> <br />
            
            首页
          </a>
        </li>
      
        
        <li class="menu-item menu-item-categories">
          <a href="/categories/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-th"></i> <br />
            
            分类
          </a>
        </li>
      
        
        <li class="menu-item menu-item-archives">
          <a href="/archives/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-archive"></i> <br />
            
            归档
          </a>
        </li>
      
        
        <li class="menu-item menu-item-tags">
          <a href="/tags/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-tags"></i> <br />
            
            标签
          </a>
        </li>
      
        
        <li class="menu-item menu-item-about">
          <a href="/about/" rel="section">
            
              <i class="menu-item-icon fa fa-fw fa-user"></i> <br />
            
            关于
          </a>
        </li>
      

      
    </ul>
  

  
</nav>



 </div>
    </header>

    <main id="main" class="main">
      <div class="main-inner">
        <div class="content-wrap">
          <div id="content" class="content">
            

  <div id="posts" class="posts-expand">
    

  

  
  
  

  <article class="post post-type-normal " itemscope itemtype="http://schema.org/Article">
    <link itemprop="mainEntityOfPage" href="http://yoursite.com/2018/01/26/pancm70/">

    <span hidden itemprop="author" itemscope itemtype="http://schema.org/Person">
      <meta itemprop="name" content="虚无境">
      <meta itemprop="description" content="">
      <meta itemprop="image" content="/images/xuwujing.png">
    </span>

    <span hidden itemprop="publisher" itemscope itemtype="http://schema.org/Organization">
      <meta itemprop="name" content="虚无境的博客">
    </span>

    
      <header class="post-header">

        
        
          <h1 class="post-title" itemprop="name headline">kafka和storm集群的环境安装</h1>
        

        <div class="post-meta">
          <span class="post-time">
            
              <span class="post-meta-item-icon">
                <i class="fa fa-calendar-o"></i>
              </span>
              
                <span class="post-meta-item-text">发表于</span>
              
              <time title="创建于" itemprop="dateCreated datePublished" datetime="2018-01-26T21:09:00+08:00">
                2018-01-26
              </time>
            

            

            
          </span>

          
            <span class="post-category" >
            
              <span class="post-meta-divider">|</span>
            
              <span class="post-meta-item-icon">
                <i class="fa fa-folder-o"></i>
              </span>
              
                <span class="post-meta-item-text">分类于</span>
              
              
                <span itemprop="about" itemscope itemtype="http://schema.org/Thing">
                  <a href="/categories/kafka/" itemprop="url" rel="index">
                    <span itemprop="name">kafka</span>
                  </a>
                </span>

                
                
              
            </span>
          

          
            
          

          
          

          

          

          

        </div>
      </header>
    

    <div class="post-body" itemprop="articleBody">

      
      

      
        <script src="\assets\js\APlayer.min.js"> </script><h2 id="前言"><a href="#前言" class="headerlink" title="前言"></a>前言</h2><p>   storm和kafka集群安装是没有必然联系的，我将这两个写在一起，是因为他们都是由zookeeper进行管理的，也都依赖于JDK的环境，为了不重复再写一遍配置，所以我将这两个写在一起。若只需一个，只需挑选自己选择的阅读即可。</p>
<p>这两者的依赖如下:</p>
<ul>
<li><strong>Storm集群</strong>：JDK1.8 , Zookeeper3.4，Storm1.1.1；</li>
<li><strong>Kafa集群</strong> : JDK1.8 ，Zookeeper3.4 ，Kafka2.12；</li>
</ul>
<p><strong>说明</strong>: Storm1.0 和Kafka2.0对JDK要求是1.7以上，Zookeeper3.0以上。</p>
<p><strong>下载地址:</strong><br>Zookeeper：<a href="https://zookeeper.apache.org/releases.html#download" target="_blank" rel="external">https://zookeeper.apache.org/releases.html#download</a><br>Storm: <a href="http://storm.apache.org/downloads.html" target="_blank" rel="external">http://storm.apache.org/downloads.html</a><br>Kafka: <a href="http://kafka.apache.org/downloads" target="_blank" rel="external">http://kafka.apache.org/downloads</a></p>
<h2 id="JDK安装"><a href="#JDK安装" class="headerlink" title="JDK安装"></a>JDK安装</h2><p><strong>每台机器都要安装JDK！！！</strong><br>  <strong>说明</strong>: 一般CentOS自带了openjdk，但是我们这里使用的是oracle的JDK。所以要写卸载openjdk，然后再安装在oracle下载好的JDK。如果已经卸载，可以跳过此步骤。<br>首先输入 java -version<br>查看是否安装了JDK，如果安装了，但版本不适合的话，就卸载<br><img src="http://img.blog.csdn.net/20171230151037761?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>输入<br>rpm -qa | grep java<br>查看信息<br><img src="http://img.blog.csdn.net/20171230151047319?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br>然后输入:<br>rpm -e –nodeps “你要卸载JDK的信息”<br>如: rpm -e –nodeps java-1.7.0-openjdk-1.7.0.99-2.6.5.1.el6.x86_64<br><img src="http://img.blog.csdn.net/20171230151054538?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>确认没有了之后，解压下载下来的JDK</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">tar  -xvf   jdk-8u144-linux-x64.tar.gz</div></pre></td></tr></table></figure>
<p>移动到opt/java文件夹中，没有就新建，然后将文件夹重命名为jdk1.8。</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">mv  jdk1.8.0_144 /opt/java</div><div class="line">mv  jdk1.8.0_144  jdk1.8</div></pre></td></tr></table></figure>
<p>然后编辑 profile 文件，添加如下配置<br> 输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">vim /etc/profile</div></pre></td></tr></table></figure>
<p>添加:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div></pre></td><td class="code"><pre><div class="line">export JAVA_HOME=/opt/java/jdk1.8</div><div class="line">export JRE_HOME=/opt/java/jdk1.8/jre</div><div class="line">export CLASSPATH=.:$JAVA_HOME/lib/dt.jar:$JAVA_HOME/lib/tools.jar:$JRE_HOME/lib</div><div class="line">export PATH=.:$&#123;JAVA_HOME&#125;/bin:$PATH</div></pre></td></tr></table></figure>
<p>添加成功之后，输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">source /etc/profile</div><div class="line">java  -version</div></pre></td></tr></table></figure>
<p>查看是否配置成功</p>
<h2 id="Zookeeper-环境安装"><a href="#Zookeeper-环境安装" class="headerlink" title="Zookeeper 环境安装"></a>Zookeeper 环境安装</h2><h3 id="1，文件准备"><a href="#1，文件准备" class="headerlink" title="1，文件准备"></a>1，文件准备</h3><p>将下载下来的Zookeeper 的配置文件进行解压<br>在linux上输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">tar  -xvf   zookeeper-3.4.10.tar.gz</div></pre></td></tr></table></figure>
<p>然后移动到/opt/zookeeper里面，没有就新建，然后将文件夹重命名为zookeeper3.4<br>输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">mv  zookeeper-3.4.10  /opt/zookeeper</div><div class="line">mv  zookeeper-3.4.10  zookeeper3.4</div></pre></td></tr></table></figure>
<h3 id="2，环境配置"><a href="#2，环境配置" class="headerlink" title="2，环境配置"></a>2，环境配置</h3><p>编辑 /etc/profile 文件<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">export  ZK_HOME=/opt/zookeeper/zookeeper3.4 </div><div class="line">export PATH=.:$&#123;JAVA_HOME&#125;/bin:$&#123;ZK_HOME&#125;/bin:$PATH</div></pre></td></tr></table></figure>
<p>输入: </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">source  /etc/profile</div></pre></td></tr></table></figure>
<p>使配置生效 </p>
<h3 id="3，修改配置文件"><a href="#3，修改配置文件" class="headerlink" title="3，修改配置文件"></a>3，修改配置文件</h3><h4 id="3-3-1-创建文件和目录"><a href="#3-3-1-创建文件和目录" class="headerlink" title="3.3.1 创建文件和目录"></a>3.3.1 创建文件和目录</h4><p> 在集群的服务器上都创建这些目录</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">mkdir   /opt/zookeeper/data  </div><div class="line">mkdir   /opt/zookeeper/dataLog</div></pre></td></tr></table></figure>
<p>并且在/opt/zookeeper/data目录下创建myid文件<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">touch  myid</div></pre></td></tr></table></figure>
<p>创建成功之后，更改myid文件。<br>我这边为了方便，将master、slave1、slave2的myid文件内容改为1,2,3<br><img src="http://img.blog.csdn.net/20171230152536678?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h4 id="3-3-2-新建zoo-cfg"><a href="#3-3-2-新建zoo-cfg" class="headerlink" title="3.3.2 新建zoo.cfg"></a>3.3.2 新建zoo.cfg</h4><p>切换到/opt/zookeeper/zookeeper3.4/conf 目录下<br>如果没有 zoo.cfg 该文件，就复制zoo_sample.cfg文件并重命名为zoo.cfg。<br>修改这个新建的zoo.cfg文件</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div></pre></td><td class="code"><pre><div class="line">dataDir=/opt/zookeeper/data</div><div class="line">dataLogDir=/opt/zookeeper/dataLog</div><div class="line">server.1=master:2888:3888</div><div class="line">server.2=slave1:2888:3888</div><div class="line">server.3=slave2:2888:3888</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20171230152800716?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>  <strong>说明</strong>：client port，顾名思义，就是客户端连接zookeeper服务的端口。这是一个TCP port。dataLogDir里是放到的顺序日志(WAL)。而dataDir里放的是内存数据结构的snapshot，便于快速恢复。为了达到性能最大化，一般建议把dataDir和dataLogDir分到不同的磁盘上，这样就可以充分利用磁盘顺序写的特性。dataDir和dataLogDir需要自己创建，目录可以自己制定，对应即可。server.1中的这个1需要和master这个机器上的dataDir目录中的myid文件中的数值对应。server.2中的这个2需要和slave1这个机器上的dataDir目录中的myid文件中的数值对应。server.3中的这个3需要和slave2这个机器上的dataDir目录中的myid文件中的数值对应。当然，数值你可以随便用，只要对应即可。2888和3888的端口号也可以随便用，因为在不同机器上，用成一样也无所谓。<br>1.tickTime：CS通信心跳数<br>Zookeeper 服务器之间或客户端与服务器之间维持心跳的时间间隔，也就是每个 tickTime 时间就会发送一个心跳。tickTime以毫秒为单位。<br>    tickTime=2000<br>2.initLimit：LF初始通信时限<br>集群中的follower服务器(F)与leader服务器(L)之间初始连接时能容忍的最多心跳数（tickTime的数量）。<br>    initLimit=10<br>3.syncLimit：LF同步通信时限<br>集群中的follower服务器与leader服务器之间请求和应答之间能容忍的最多心跳数（tickTime的数量）。<br>    syncLimit=5 </p>
<p>依旧将zookeeper传输到其他的机器上，记得更改 /opt/zookeeper/data 下的myid，这个不能一致。<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">scp -r /opt/zookeeper root@slave1:/opt</div><div class="line">scp -r /opt/zookeeper root@slave2:/opt</div></pre></td></tr></table></figure>
<h3 id="4，启动zookeeper"><a href="#4，启动zookeeper" class="headerlink" title="4，启动zookeeper"></a>4，启动zookeeper</h3><p>   因为zookeeper是选举制，它的主从关系并不是像hadoop那样指定的，具体可以看官方的文档说明。<br>  成功配置zookeeper之后，在每台机器上启动zookeeper。<br> 切换到zookeeper目录下</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">cd /opt/zookeeper/zookeeper3.4/bin</div></pre></td></tr></table></figure>
<p>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">zkServer.sh start</div></pre></td></tr></table></figure>
<p>成功启动之后<br>查看状态输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">zkServer.sh status</div></pre></td></tr></table></figure>
<p>可以查看各个机器上zookeeper的leader和follower<br><img src="http://img.blog.csdn.net/20171230152823369?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h2 id="Storm-环境安装"><a href="#Storm-环境安装" class="headerlink" title="Storm 环境安装"></a>Storm 环境安装</h2><h3 id="1，文件准备-1"><a href="#1，文件准备-1" class="headerlink" title="1，文件准备"></a>1，文件准备</h3><p>将下载下来的storm的配置文件进行解压<br>在linux上输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">tar  -xvf   apache-storm-1.1.1.tar.gz</div></pre></td></tr></table></figure>
<p>然后移动到/opt/storm里面，没有就新建，然后将文件夹重命名为storm1.1<br>输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">mv  apache-storm-1.1.1  /opt/storm</div><div class="line"> mv  apache-storm-1.1.1  storm1.1</div></pre></td></tr></table></figure>
<h3 id="2，环境配置-1"><a href="#2，环境配置-1" class="headerlink" title="2，环境配置"></a>2，环境配置</h3><p>编辑 /etc/profile 文件<br>        添加：<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">export STORM_HOME=/opt/storm/storm1.1</div><div class="line">export PATH=.:$&#123;JAVA_HOME&#125;/bin:$&#123;ZK_HOME&#125;/bin:$&#123;STORM_HOME&#125;/bin:$PATH</div></pre></td></tr></table></figure></p>
<p> 输入 storm version 查看版本信息<br>  <img src="http://img.blog.csdn.net/20180126203955725?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h3 id="3，修改配置文件-1"><a href="#3，修改配置文件-1" class="headerlink" title="3，修改配置文件"></a>3，修改配置文件</h3><p>编辑 storm/conf 的 storm.yarm。</p>
<p>进行如下编辑:<br>输入:<br>vim storm.yarm</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div><div class="line">3</div><div class="line">4</div><div class="line">5</div><div class="line">6</div><div class="line">7</div><div class="line">8</div><div class="line">9</div><div class="line">10</div><div class="line">11</div><div class="line">12</div><div class="line">13</div><div class="line">14</div></pre></td><td class="code"><pre><div class="line">storm.zookeeper.servers:</div><div class="line">     - &quot;master&quot;</div><div class="line">     - &quot;slave1&quot;</div><div class="line">     - &quot;slave2&quot;</div><div class="line"></div><div class="line">storm.local.dir: &quot;/root/storm&quot;</div><div class="line"></div><div class="line">nimbus.seeds: [&quot;master&quot;]</div><div class="line"></div><div class="line">supervisor.slots.ports:</div><div class="line">    - 6700</div><div class="line">    - 6701</div><div class="line">    - 6702</div><div class="line">    - 6703</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20180126204334259?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br><strong>说明:</strong></p>
<ol>
<li>storm.zookeeper.servers是指定zookeeper的服务地址。<br>因为storm的存储信息在zookeeper上，所以要配置zookeeper的服务地址。如果zookeeper是单机就只用指定一个！</li>
<li>storm.local.dir 表示存储目录。<br>Nimbus和Supervisor守护进程需要在本地磁盘上存储一个目录来存储少量的状态（比如jar，confs等等）。可以在每台机器创建，并给于权限。<br>3.nimbus.seeds 表示候选的主机。<br>worker需要知道那一台机器是主机候选(zookeeper集群是选举制)，从而可以下载 topology jars 和confs。<br>4.supervisor.slots.ports 表示worker 端口。<br>对于每一个supervisor机器，我们可以通过这项来配置运行多少worker在这台机器上。每一个worker使用一个单独的port来接受消息，这个端口同样定义了那些端口是开放使用的。如果你在这里定义了5个端口，就意味着这个supervisor节点上最多可以运行5个worker。如果定义3个端口，则意味着最多可以运行3个worker。在默认情况下(即配置在defaults.yaml中)，会有有四个workers运行在 6700, 6701, 6702, and 6703端口。<br>supervisor并不会在启动时就立即启动这四个worker。而是接受到分配的任务时，才会启动，具体启动几个worker也要根据我们Topology在这个supervisor需要几个worker来确定。如果指定Topology只会由一个worker执行，那么supervisor就启动一个worker，并不会启动所有。</li>
</ol>
<p><strong>注</strong>: 这些配置前面不要有空格！！！，不然会报错。 这里使用的是主机名(做了映射)，也可以使用IP。实际的以自己的为准。</p>
<p>可以使用scp命令或者ftp软件将storm复制到其他机器上<br><img src="http://img.blog.csdn.net/20180126204325034?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>成功配置之后，然后就可以启动Storm了，不过要确保JDK、Zookeeper已经正确安装，并且Zookeeper已经成功启动。</p>
<h3 id="4，启动Storm"><a href="#4，启动Storm" class="headerlink" title="4，启动Storm"></a>4，启动Storm</h3><p>切换到 storm/bin 目录下<br>在主节点(master)启动输入：</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">storm nimbus &gt;/dev/null 2&gt;&amp;1 &amp;</div></pre></td></tr></table></figure>
<p>访问web界面(master)输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">storm ui</div></pre></td></tr></table></figure>
<p>从节点(slave1，slave2)输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">storm supervisor &gt;/dev/null 2&gt;&amp;1 &amp;</div></pre></td></tr></table></figure>
<p>在浏览器界面输入: 8080端口<br>成功打开该界面，表示环境配置成功:<br><img src="http://img.blog.csdn.net/20180126204703636?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<h2 id="kafka的环境安装"><a href="#kafka的环境安装" class="headerlink" title="kafka的环境安装"></a>kafka的环境安装</h2><h3 id="1，文件准备-2"><a href="#1，文件准备-2" class="headerlink" title="1，文件准备"></a>1，文件准备</h3><p>将下载下来的Kafka的配置文件进行解压<br>在linux上输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">tar  -xvf   kafka_2.12-1.0.0.tgz</div></pre></td></tr></table></figure>
<p>然后移动到/opt/kafka里面，没有就新建，然后将文件夹重命名为kafka2.12<br>输入</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">mv  kafka_2.12-1.0.0  /opt/kafka</div><div class="line"> mv  kafka_2.12-1.0.0  kafka2.12</div></pre></td></tr></table></figure>
<h3 id="2，环境配置-2"><a href="#2，环境配置-2" class="headerlink" title="2，环境配置"></a>2，环境配置</h3><p>编辑 /etc/profile 文件<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">export  KAFKA_HOME=/opt/kafka/kafka2.12 </div><div class="line">export PATH=.:$&#123;JAVA_HOME&#125;/bin:$&#123;KAFKA_HOME&#125;/bin:$&#123;ZK_HOME&#125;/bin:$PATH</div></pre></td></tr></table></figure>
<p>输入: </p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">source  /etc/profile</div></pre></td></tr></table></figure>
<p>使配置生效 </p>
<h3 id="3，修改配置文件-2"><a href="#3，修改配置文件-2" class="headerlink" title="3，修改配置文件"></a>3，修改配置文件</h3><p><strong>注</strong>:其实要说的话，如果是单机的话，kafka的配置文件可以不用修改，直接到bin目录下启动就可以了。但是我们这里是集群，所以稍微改下就可以了。</p>
<p>切换到kafka/config 目录下<br>编辑<strong>server.properties</strong> 文件<br>需要更改的是Zookeeper的地址:<br>找到Zookeeper的配置，指定Zookeeper集群的地址，设置如下修改就可以了<br><figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">zookeeper.connect=master:2181,slave1:2181,slave2:2181</div><div class="line">zookeeper.connection.timeout.ms=6000</div></pre></td></tr></table></figure></p>
<p>其它可以选择更改的有</p>
<p><strong>1 ，num.partitions  表示指定的分区，默认为1</strong><br><strong>2，log.dirs  kafka的日志路径，这个按照个人需求更改就行</strong><br><strong>3,  broker.id:非负整数，用于唯一标识broker，每台不一样</strong></p>
<p>…<br><strong>注</strong>:还有其它的配置，可以查看官方文档，如果没有特别要求，使用默认的就可以了。</p>
<p>配置好之后，记得使用scp 命令传输到其它的集群上，记得更改<strong>server.properties</strong> 文件！</p>
<h3 id="4，启动kafka"><a href="#4，启动kafka" class="headerlink" title="4，启动kafka"></a>4，启动kafka</h3><p>集群每台集群都需要操作！</p>
<p>   切换到kafka/bin 目录下<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-server-start.sh</div></pre></td></tr></table></figure>
<p>然后输入jps名称查看是否成功启动:<br><img src="http://img.blog.csdn.net/20180126205434422?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>成功启动之后，可以进行简单的测试下<br>首先创建个topic<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-topics.sh --zookeeper master:2181 --create --topic t_test --partitions 5  --replication-factor 2</div></pre></td></tr></table></figure>
<p><strong>说明:</strong> 这里是创建了一个名为  t_test 的topic，并且指定了5个分区，每个分区指定了2个副本数。如果不指定分区，默认的分区就是配置文件配置的。 </p>
<p>然后进行生产数据<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-console-producer.sh --broker-list master:9092 --topic t_test</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20180126210106287?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"></p>
<p>可以使用进行Ctrl+D 退出</p>
<p>然后我们再打开一个xshell窗口<br>进行消费<br>输入:</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-console-consumer.sh  --zookeeper master:2181  --topic t_test --from-beginning</div></pre></td></tr></table></figure>
<p><img src="http://img.blog.csdn.net/20180126210233242?watermark/2/text/aHR0cDovL2Jsb2cuY3Nkbi5uZXQvcWF6d3N4cGNt/font/5a6L5L2T/fontsize/400/fill/I0JBQkFCMA==/dissolve/70/gravity/SouthEast" alt="这里写图片描述"><br>可以使用进行Ctrl+C 退出</p>
<p>可以看到数据已经正常消费了。</p>
<h3 id="5，kafka的一些常用命令"><a href="#5，kafka的一些常用命令" class="headerlink" title="5，kafka的一些常用命令"></a>5，kafka的一些常用命令</h3><p>1.启动和关闭kafka</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div><div class="line">2</div></pre></td><td class="code"><pre><div class="line">bin/kafka-server-start.sh config/server.properties &gt;&gt;/dev/null 2&gt;&amp;1 &amp;</div><div class="line">bin/kafka-server-stop.sh</div></pre></td></tr></table></figure>
<p>2.查看kafka集群中的消息队列和具体队列<br>查看集群所有的topic</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-topics.sh --zookeeper master:2181,slave1:2181,slave2:2181 --list</div></pre></td></tr></table></figure>
<p> 查看一个topic的信息</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-topics.sh --zookeeper master:2181 --describe --topic t_test</div></pre></td></tr></table></figure>
<p>3.创建Topic</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-topics.sh --zookeeper master:2181 --create --topic t_test --partitions 5  --replication-factor 2</div></pre></td></tr></table></figure>
<p>4.生产数据和消费数据</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-console-producer.sh --broker-list master:9092 --topic t_test</div></pre></td></tr></table></figure>
<p>Ctrl+D 退出</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-console-consumer.sh  --zookeeper master:2181  --topic t_test --from-beginning</div></pre></td></tr></table></figure>
<p>Ctrl+C 退出</p>
<p>5.kafka的删除命令</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-topics.sh --delete --zookeeper master:2181 --topic t_test</div></pre></td></tr></table></figure>
<p>6,添加分区</p>
<figure class="highlight plain"><table><tr><td class="gutter"><pre><div class="line">1</div></pre></td><td class="code"><pre><div class="line">kafka-topics.sh --alter --topict_test --zookeeper master:2181 --partitions 10</div></pre></td></tr></table></figure>
<h2 id="其它"><a href="#其它" class="headerlink" title="其它"></a>其它</h2><p>Storm环境搭建参考官方文档:<br><a href="http://storm.apache.org/releases/1.1.1/Setting-up-a-Storm-cluster.html" target="_blank" rel="external">http://storm.apache.org/releases/1.1.1/Setting-up-a-Storm-cluster.html</a></p>
<p>Kafka环境搭建参考官方文档:<br> <a href="http://kafka.apache.org/quickstart" target="_blank" rel="external">http://kafka.apache.org/quickstart</a></p>
<p>到此，本文结束，谢谢阅读！</p>

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>

    <div>
      
        

      
    </div>
     
    <div>
	 +
	  
<div style="text-align:center;color: #ccc;font-size:14px;">
------ 本文结束 ------</div>
<br/>
<div style="border: 1px solid black">
<div style="margin-left:10px">
<span style="font-weight:blod">版权声明</span>
<!-- <img src="/images/xuwujing.png" > -->
<br/>
<p style="font-size: 10px;line-height: 30px"><a href="http://www.panchengming.com/" style="color:#258FC6">xuwujing's Notes</a> by <a href="http://www.panchengming.com/" style="color:#258FC6">ChengMing Pan</a> is licensed under a <a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" style="color:#258FC6">Creative Commons BY-NC-ND 4.0 International License</a>.<br/>
由<a href="http://www.panchengming.com/" style="color:#258FC6">虚无境</a>创作并维护的<a href="http://www.panchengming.com/" style="color:#258FC6">xuwujing's Notes</a>博客采用<a href="https://creativecommons.org/licenses/by-nc-nd/4.0/" style="color:#258FC6">创作共用保留署名-非商业-禁止演绎4.0国际许可证</a>。<br/>
本文首发于<a href="http://www.panchengming.com/" style="color:#258FC6">xuwujing's Notes</a> 博客（ <a href="http://www.panchengming.com/" style="color:#258FC6">http://www.panchengming.com/</a> ），版权所有，侵权必究。</p>
</div>
</div>

	
	</div>

    <footer class="post-footer">
      
        <div class="post-tags">
          
            <a href="/tags/java/" rel="tag"># java</a>
          
            <a href="/tags/大数据/" rel="tag"># 大数据</a>
          
            <a href="/tags/kafka/" rel="tag"># kafka</a>
          
            <a href="/tags/storm/" rel="tag"># storm</a>
          
        </div>
      

      
      
      

      
        <div class="post-nav">
          <div class="post-nav-next post-nav-item">
            
              <a href="/2018/01/25/pancm69/" rel="next" title="Logback日志配置的简单使用">
                <i class="fa fa-chevron-left"></i> Logback日志配置的简单使用
              </a>
            
          </div>

          <span class="post-nav-divider"></span>

          <div class="post-nav-prev post-nav-item">
            
              <a href="/2018/01/28/pancm71/" rel="prev" title="Kafka 使用Java实现数据的生产和消费demo">
                Kafka 使用Java实现数据的生产和消费demo <i class="fa fa-chevron-right"></i>
              </a>
            
          </div>
        </div>
      

      
      
    </footer>
  </article>



    <div class="post-spread">
      
    </div>
  </div>


          </div>
          


          
  <div class="comments" id="comments">
    
  </div>


        </div>
        
          
  
  <div class="sidebar-toggle">
    <div class="sidebar-toggle-line-wrap">
      <span class="sidebar-toggle-line sidebar-toggle-line-first"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-middle"></span>
      <span class="sidebar-toggle-line sidebar-toggle-line-last"></span>
    </div>
  </div>

  <aside id="sidebar" class="sidebar">
    <div class="sidebar-inner">

      

      
        <ul class="sidebar-nav motion-element">
          <li class="sidebar-nav-toc sidebar-nav-active" data-target="post-toc-wrap" >
            文章目录
          </li>
          <li class="sidebar-nav-overview" data-target="site-overview">
            站点概览
          </li>
        </ul>
      

      <section class="site-overview sidebar-panel">
        <div class="site-author motion-element" itemprop="author" itemscope itemtype="http://schema.org/Person">
          <img class="site-author-image" itemprop="image"
               src="/images/xuwujing.png"
               alt="虚无境" />
          <p class="site-author-name" itemprop="name">虚无境</p>
           
              <p class="site-description motion-element" itemprop="description">The way of the future!</p>
          
        </div>
        <nav class="site-state motion-element">

          
            <div class="site-state-item site-state-posts">
              <a href="/archives/">
                <span class="site-state-item-count">136</span>
                <span class="site-state-item-name">日志</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-categories">
              <a href="/categories/index.html">
                <span class="site-state-item-count">30</span>
                <span class="site-state-item-name">分类</span>
              </a>
            </div>
          

          
            
            
            <div class="site-state-item site-state-tags">
              <a href="/tags/index.html">
                <span class="site-state-item-count">59</span>
                <span class="site-state-item-name">标签</span>
              </a>
            </div>
          

        </nav>

        

        <div class="links-of-author motion-element">
          
            
              <span class="links-of-author-item">
                <a href="https://github.com/xuwujing" target="_blank" title="github">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  github
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="http://blog.csdn.net/qazwsxpcm?viewmode=list" target="_blank" title="csdn">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  csdn
                </a>
              </span>
            
              <span class="links-of-author-item">
                <a href="https://home.cnblogs.com/u/xuwujing/" target="_blank" title="cnblogs">
                  
                    <i class="fa fa-fw fa-globe"></i>
                  
                  cnblogs
                </a>
              </span>
            
          
        </div>

        
        

        
        
          <div class="links-of-blogroll motion-element links-of-blogroll-inline">
            <div class="links-of-blogroll-title">
              <i class="fa  fa-fw fa-globe"></i>
              
            </div>
            <ul class="links-of-blogroll-list">
              
                <li class="links-of-blogroll-item">
                  <a href="http://www.woainia.site/" title="woainia" target="_blank">woainia</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://cmsblogs.com/" title="chenssy" target="_blank">chenssy</a>
                </li>
              
                <li class="links-of-blogroll-item">
                  <a href="http://italker.imisty.cn" title="xiaowu" target="_blank">xiaowu</a>
                </li>
              
            </ul>
          </div>
        

        


      </section>

      
      <!--noindex-->
        <section class="post-toc-wrap motion-element sidebar-panel sidebar-panel-active">
          <div class="post-toc">

            
              
            

            
              <div class="post-toc-content"><ol class="nav"><li class="nav-item nav-level-2"><a class="nav-link" href="#前言"><span class="nav-number">1.</span> <span class="nav-text">前言</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#JDK安装"><span class="nav-number">2.</span> <span class="nav-text">JDK安装</span></a></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Zookeeper-环境安装"><span class="nav-number">3.</span> <span class="nav-text">Zookeeper 环境安装</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1，文件准备"><span class="nav-number">3.1.</span> <span class="nav-text">1，文件准备</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2，环境配置"><span class="nav-number">3.2.</span> <span class="nav-text">2，环境配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3，修改配置文件"><span class="nav-number">3.3.</span> <span class="nav-text">3，修改配置文件</span></a><ol class="nav-child"><li class="nav-item nav-level-4"><a class="nav-link" href="#3-3-1-创建文件和目录"><span class="nav-number">3.3.1.</span> <span class="nav-text">3.3.1 创建文件和目录</span></a></li><li class="nav-item nav-level-4"><a class="nav-link" href="#3-3-2-新建zoo-cfg"><span class="nav-number">3.3.2.</span> <span class="nav-text">3.3.2 新建zoo.cfg</span></a></li></ol></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4，启动zookeeper"><span class="nav-number">3.4.</span> <span class="nav-text">4，启动zookeeper</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#Storm-环境安装"><span class="nav-number">4.</span> <span class="nav-text">Storm 环境安装</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1，文件准备-1"><span class="nav-number">4.1.</span> <span class="nav-text">1，文件准备</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2，环境配置-1"><span class="nav-number">4.2.</span> <span class="nav-text">2，环境配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3，修改配置文件-1"><span class="nav-number">4.3.</span> <span class="nav-text">3，修改配置文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4，启动Storm"><span class="nav-number">4.4.</span> <span class="nav-text">4，启动Storm</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#kafka的环境安装"><span class="nav-number">5.</span> <span class="nav-text">kafka的环境安装</span></a><ol class="nav-child"><li class="nav-item nav-level-3"><a class="nav-link" href="#1，文件准备-2"><span class="nav-number">5.1.</span> <span class="nav-text">1，文件准备</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#2，环境配置-2"><span class="nav-number">5.2.</span> <span class="nav-text">2，环境配置</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#3，修改配置文件-2"><span class="nav-number">5.3.</span> <span class="nav-text">3，修改配置文件</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#4，启动kafka"><span class="nav-number">5.4.</span> <span class="nav-text">4，启动kafka</span></a></li><li class="nav-item nav-level-3"><a class="nav-link" href="#5，kafka的一些常用命令"><span class="nav-number">5.5.</span> <span class="nav-text">5，kafka的一些常用命令</span></a></li></ol></li><li class="nav-item nav-level-2"><a class="nav-link" href="#其它"><span class="nav-number">6.</span> <span class="nav-text">其它</span></a></li></ol></div>
            

          </div>
        </section>
      <!--/noindex-->
      

      

    </div>
  </aside>


        
      </div>
    </main>

    <footer id="footer" class="footer">
      <div class="footer-inner">
        <div class="copyright" >
  
  &copy; 
  <span itemprop="copyrightYear">2021</span>
  <span class="with-love">
    <i class="fa fa-heart"></i>
  </span>
  <span class="author" itemprop="copyrightHolder">虚无境</span>
</div>


<div class="powered-by">
  由 <a class="theme-link" href="https://hexo.io">Hexo</a> 强力驱动
</div>

<div class="theme-info">
  主题 -
  <a class="theme-link" href="https://github.com/iissnan/hexo-theme-next">
    NexT.Pisces
  </a>
</div>

  <script async src="//busuanzi.ibruce.info/busuanzi/2.3/busuanzi.pure.mini.js">
</script>
 | 
本站总访问量<span id="busuanzi_value_site_pv"></span>次
 | 
本站访客数<span id="busuanzi_value_site_uv"></span>人次
<iframe frameborder="no" border="0" marginwidth="0" marginheight="0" width=330 height=86 src="//music.163.com/outchain/player?type=2&id=857896&auto=0&height=66"></iframe>



        

        
      </div>
    </footer>

    
      <div class="back-to-top">
        <i class="fa fa-arrow-up"></i>
        
      </div>
    

  </div>

  

<script type="text/javascript">
  if (Object.prototype.toString.call(window.Promise) !== '[object Function]') {
    window.Promise = null;
  }
</script>









  












  
  <script type="text/javascript" src="/lib/jquery/index.js?v=2.1.3"></script>

  
  <script type="text/javascript" src="/lib/fastclick/lib/fastclick.min.js?v=1.0.6"></script>

  
  <script type="text/javascript" src="/lib/jquery_lazyload/jquery.lazyload.js?v=1.9.7"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/velocity/velocity.ui.min.js?v=1.2.1"></script>

  
  <script type="text/javascript" src="/lib/fancybox/source/jquery.fancybox.pack.js?v=2.1.5"></script>


  


  <script type="text/javascript" src="/js/src/utils.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/motion.js?v=5.1.1"></script>



  
  


  <script type="text/javascript" src="/js/src/affix.js?v=5.1.1"></script>

  <script type="text/javascript" src="/js/src/schemes/pisces.js?v=5.1.1"></script>



  
  <script type="text/javascript" src="/js/src/scrollspy.js?v=5.1.1"></script>
<script type="text/javascript" src="/js/src/post-details.js?v=5.1.1"></script>



  


  <script type="text/javascript" src="/js/src/bootstrap.js?v=5.1.1"></script>



  


  




	





  





  





  






  





  

  

  

  

  

  

</body>
</html>
